package HuaWeiPractice;

import java.util.Scanner;

/**
 * created by ysy 2022/3/5 19:59
 *
 * @author 杨双洋
 * @version 1.0
 * @Email Yangsybd@163.com
 */
public class StringSplitBy8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String stringLine = sc.nextLine();
        if (stringLine != null) {
            int length = stringLine.length();
            System.out.println("字符串长度是：" + length);
            //下面次数加上三种情况判断为优化：
            int s = 0;
            if (length == 8) {
                s = 1;
            }
            if (length % 8 == 0) {
                s = length / 8;
            } else {
                s = length / 8 + 1;
            }

            System.out.println("s是：" + s);
            String[] stringsArray = new String[s];
            for (int i = 0; i < s; i++) {
                if (stringLine.length() > 8) {
                    String splitLine = stringLine.substring(0, 8);
                    stringsArray[i] = splitLine;
                    stringLine = stringLine.substring(8);
                } else {
                    stringsArray[i] = stringLine;
                }
            }
            for (int i = 0; i < s; i++) {
                if (stringsArray[i].length() == 8) {
                    System.out.println(stringsArray[i]);
                } else {
                    switch (stringsArray[i].length()) {
                        case 1:
                            System.out.println(stringsArray[i] + "0000000");
                            break;
                        case 2:
                            System.out.println(stringsArray[i] + "000000");
                            break;
                        case 3:
                            System.out.println(stringsArray[i] + "00000");
                            break;
                        case 4:
                            System.out.println(stringsArray[i] + "0000");
                            break;
                        case 5:
                            System.out.println(stringsArray[i] + "000");
                            break;
                        case 6:
                            System.out.println(stringsArray[i] + "00");
                            break;
                        case 7:
                            System.out.println(stringsArray[i] + "0");
                            break;
                    }
                }
            }
        }
    }
}

